﻿/*
define(function(require, exports, module) {
    var $ = require("$"),
        config = require("./setting"),
        method = require("./method");
    require("./extend");
    require("./element");
    require("./plugins");
    $('[data-toggle="selectGoods"]').length>0&&require.async("dist/selectgoods2/init", function(selectgoods) {
       selectgoods.init(document);
    });

    //selectgoods.init(document);
    window.template = require("./template");
    $.ajaxSetup({
        cache: false,
        dataType: "json"
    });

    $('form.form-validate').length > 0 && require.async("dist/form/init", function(form) {
        var $form = $("form.form-validate");
        $form.length && form.init($form);


    });
    $('table').length > 0 && require.async("dist/table/init");

    return {
        config: config,
        method: method,
        v: "1.0.1"
    }
});
*/
define(function(require, exports, module) {
    var $ = require("$"),
        config = require("./setting"),
        method = require("./method");
    require("./extend")
    require("./element")
    var plugin = require("./plugins");
    plugin.init(document);
    require("./jqplugins")
    var entity = require("./entity");
    window.template = require("./template");
    // require("./holder.js")
    $.ajaxSetup({
        cache: false,
        dataType: "json"
    });

    $('form.form-validate').length > 0 && require.async("dist/form/init", function(form) {
        var $form = $("form.form-validate");
        $form.length && form.init($form);
    });
    $('table').length > 0 && require.async("dist/table/init");


    template.helper('transMsgTime', function(date) {
        return method.transMsgTime(1e3 * parseInt(date)); //注册格式化时间。。。刚刚 昨天。2小时去前
    });
    // var fit_modal_body;

    // fit_modal_body = function(modal) {
    //     var body, bodypaddings, header, headerheight, height, modalheight;
    //     header = $(".modal-header", modal);
    //     body = $(".modal-body", modal);
    //     modalheight = parseInt(modal.css("height"));
    //     headerheight = parseInt(header.css("height")) + parseInt(header.css("padding-top")) + parseInt(header.css("padding-bottom"));
    //     bodypaddings = parseInt(body.css("padding-top")) + parseInt(body.css("padding-bottom"));
    //     height = modalheight - headerheight - bodypaddings - 5;
    //     return body.css("max-height", "" + height + "px").css("overflow","auto");
    // };

    // $(window).resize(function() {
    //     return fit_modal_body($(".modal"));
    // });

    return {
        config: config,
        method: method,
        plugin: plugin,
        entity: entity,
        v: "1.0.1"
    }
});
